]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: Remove bump on key press
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 5 Nov 2012 20:38:50 +0000 (15:38 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 11 Mar 2013 19:08:20 +0000 (15:08 -0400)
Any key press of a character-emitting key will now raise the shell.
Note that the key press will not be forwarded to the entry yet.

https://bugzilla.gnome.org/show_bug.cgi?id=686740

js/ui/screenShield.js

index e01d181e046431f6f76df93b7d07aea238626177..4081219be8c8635812e35b4c136ce558e60e36f2 100644 (file)
@@ -39,11 +39,6 @@ const N_ARROWS = 3;
 const ARROW_ANIMATION_TIME = 0.6;
 const ARROW_ANIMATION_PEAK_OPACITY = 0.4;
 
-// The distance in px that the lock screen will move to when pressing
-// a key that has no effect in the lock screen (bumping it)
-const BUMP_SIZE = 25;
-const BUMP_TIME = 0.3;
-
 const SUMMARY_ICON_SIZE = 48;
 
 // ScreenShield animation time
@@ -592,26 +587,21 @@ const ScreenShield = new Lang.Class({
 
     _onLockScreenKeyPress: function(actor, event) {
         let symbol = event.get_key_symbol();
+        let unichar = event.get_key_unicode();
 
         // Do nothing if the lock screen is not fully shown.
         // This avoids reusing the previous (and stale) unlock
         // dialog if esc is pressed while the curtain is going
         // down after cancel.
-        // Similarly, don't bump if the lock screen is not showing or is
-        // animating, as the bump overrides the animation and would
-        // remove any onComplete handler.
 
         if (this._lockScreenState != MessageTray.State.SHOWN)
             return false;
 
-        if (symbol == Clutter.KEY_Escape ||
-            symbol == Clutter.KEY_Return ||
-            symbol == Clutter.KEY_KP_Enter) {
-            this._liftShield(false, 0);
-            return true;
-        }
+        if (!(GLib.unichar_isprint(unichar) || symbol == Clutter.KEY_Escape))
+            return false;
 
-        this._bumpLockScreen();
+        this._ensureUnlockDialog(true, true);
+        this._liftShield(true, 0);
         return true;
     },
 
@@ -849,21 +839,6 @@ const ScreenShield = new Lang.Class({
         this._hideLockScreen(false, 0);
     },
 
-    _bumpLockScreen: function() {
-        Tweener.removeTweens(this._lockScreenGroup);
-        Tweener.addTween(this._lockScreenGroup,
-                         { y: -BUMP_SIZE,
-                           time: BUMP_TIME / 2,
-                           transition: 'easeOutQuad',
-                           onComplete: function() {
-                               Tweener.addTween(this,
-                                                { y: 0,
-                                                  time: BUMP_TIME / 2,
-                                                  transition: 'easeInQuad' });
-                           }
-                         });
-    },
-
     _hideLockScreenComplete: function() {
         if (Main.sessionMode.currentMode == 'lock-screen')
             Main.sessionMode.popMode('lock-screen');